package com.intcast;

/*
找1~1000之间的素数
*/
public class Demo08 {
    public static void main(String[] args) {

        int sucount = 0;
        for (int i = 2; i <= 1000; i++) {
            int count = 0;
            for (int j = 2; j <= i / 2; j++) {
                if (i % j == 0) {
                    count++;
                    break;
                }
            }
            if (count == 0) {
                System.out.print(i + " ");
                sucount++;
                if (sucount % 5 == 0) {
                    System.out.println();
                }
            }
        }
    }
}
